home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 17 / AMIGAplus Sonderheft 17 (1999)(ICP)(DE)[!].iso / Rexx / AnimToAnimBrush.pprx < prev    next >
Text File  |  1997-05-06  |  3KB  |  117 lines

  1. /* Personal Paint Amiga Rexx script - Copyright © 1995-1997 Cloanto Italia srl */
  2.  
  3. /* $VER: AnimToAnimBrush.pprx 1.1 */
  4.  
  5. /** ENG
  6.   This script converts the current animation into an anim-brush.
  7.  
  8.   Please note that this script is not equivalent to the "Define
  9.   Brush/Anim-Brush" tool in the toolbar, which is used to create
  10.   an anim-brush of any size. This script creates an anim-brush
  11.   as large as the current animation.
  12. */
  13.  
  14. /** DEU
  15.   Dieses Skript dient zur Umwandlung der aktuellen Animation in einen
  16.   Anim-Brush.
  17.  
  18.   Hinweis: Dieses Skript unterscheidet sich insofern von der Funktion
  19.   "Pinsel/Animationspinsel definieren" in der Werkzeugleiste, als daß es
  20.   keinen Animationspinsel beliebiger Größe erstellen kann. Vielmehr ist die
  21.   Größe der mit diesem Skript erstellten Animationspinsel immer identisch
  22.   mit der der aktuellen Animation.
  23.  
  24. */
  25.  
  26. /** ITA
  27.   Questo script converte l'animazione attuale in un anim-brush.
  28.  
  29.   Si noti che questo script non equivale allo strumento "Definire
  30.   pennello/Anim-Brush" della barra degli strumenti, che si può usare per
  31.   creare un anim-brush di dimensione qualsiasi. Questo script crea un
  32.   anim-brush avente dimensioni pari a quelle dell'animazione corrente.
  33. */
  34.  
  35. IF ARG(1, EXISTS) THEN
  36.     PARSE ARG PPPORT
  37. ELSE
  38.     PPPORT = 'PPAINT'
  39.  
  40. IF ~SHOW('P', PPPORT) THEN DO
  41.     IF EXISTS('PPaint:PPaint') THEN DO
  42.         ADDRESS COMMAND 'Run >NIL: PPaint:PPaint'
  43.         DO 30 WHILE ~SHOW('P',PPPORT)
  44.              ADDRESS COMMAND 'Wait >NIL: 1 SEC'
  45.         END
  46.     END
  47.     ELSE DO
  48.         SAY "Personal Paint could not be loaded."
  49.         EXIT 10
  50.     END
  51. END
  52.  
  53. IF ~SHOW('P', PPPORT) THEN DO
  54.     SAY 'Personal Paint Rexx port could not be opened.'
  55.     EXIT 10
  56. END
  57.  
  58. ADDRESS VALUE PPPORT
  59. OPTIONS RESULTS
  60. OPTIONS FAILAT 10000
  61.  
  62. Get 'LANG'
  63. IF RESULT = 1 THEN DO        /* Deutsch */
  64.     txt_err_oldclient = 'Für dieses Skript_ist eine neuere Version_von Personal Paint erforderlich'
  65. END
  66. ELSE IF RESULT = 2 THEN DO    /* Italiano */
  67.     txt_err_oldclient = 'Questa procedura richiede_una versione più recente_di Personal Paint'
  68. END
  69. ELSE DO                /* English */
  70.     txt_err_oldclient = 'This script requires a newer_version of Personal Paint'
  71. END
  72.  
  73. Version 'REXX'
  74. IF RESULT < 7 THEN DO
  75.     RequestNotify 'PROMPT "'txt_err_oldclient'"'
  76.     EXIT 10
  77. END
  78.  
  79.  
  80. FreeBrush
  81. IF RC ~= 0 THEN
  82.     EXIT RC
  83.  
  84.  
  85. LockGUI
  86. loaded = 0
  87. GetFrames
  88. frnum = RESULT
  89. IF frnum = 0 THEN DO
  90.     LoadAnimation 'NEW'
  91.     IF RC = 0 THEN DO
  92.         GetFrames
  93.         frnum = RESULT
  94.         loaded = 1
  95.     END
  96. END
  97. IF frnum > 0 THEN DO
  98.     Get 'IMAGEW'
  99.     x1 = RESULT - 1
  100.     Get 'IMAGEH'
  101.     y1 = RESULT - 1
  102.  
  103.     GetFramePosition
  104.     fpos = RESULT
  105.     SetFramePosition 1
  106.     DefineBrush 0 0 x1 y1 'FRAMES' frnum
  107.     SetFramePosition fpos
  108.     IF RC = 0 THEN
  109.         SaveAnimBrush
  110.     FreeBrush 'FORCE'
  111. END
  112. IF loaded THEN DO
  113.     DeleteFrames 'ALL FORCE'
  114.     ClearImage 'FORCE'
  115. END
  116. UnlockGUI
  117.